/*
 * @Descripttion: 文件说明
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-07-29 10:40:41
 * @LastEditors: GW
 * @LastEditTime: 2022-05-09 16:27:08
 */
import { axios } from "../../utils/request";
//会计科目表
const api = {
    PageList: "/erp/accounting/page",
    Save: "/erp/accounting/save",
    DELETE: "/erp/accounting/batchDelete",
    getAccount: "/erp/accountingType/getAll",
    page: "/erp/accounting/getOneByCondition",
    detail: "/erp/accounting/getDetail",
};


/**
 * 获取列表
 */
export function pageList (parameter) {
    return axios({
        url: api.PageList,
        method: "get",
        params: parameter,
        timeout: 500000,
    });
}

/**
 * 新增/修改
 * @param {*} data
 */
export function save (data) {
    console.log(data);
    return axios({
        url: api.Save,
        method: "post",
        data: data
    });
}

/**
 * 删除
 */
export function deleteAccount (data) {
    return axios({
        url: api.DELETE,
        method: "delete",
        params: data
    });
}

/**
 * 获取会计科目分类
 */
export function getAccount (data) {
    return axios({
        url: api.getAccount,
        method: "get",
        params: data,
    });
}

/**
 * 翻页
 */
export function pageRun (data) {
    return axios({
        url: api.page,
        method: "get",
        params: data,
    });
}


export function getById (parameter) {
    return axios({
        url: api.detail,
        method: "get",
        params: parameter,
        timeout: 500000,
    });
}